Skip to content

Conversation

MaximSmolskiy
Copy link
Member

Description of Change

Fix deprecation warning for macOS:

[ 48%] Building CXX object sorting/CMakeFiles/bogo_sort.dir/bogo_sort.cpp.o
/Users/runner/work/C-Plus-Plus/C-Plus-Plus/sorting/bogo_sort.cpp:54:14: warning: 'random_shuffle<int *>' is deprecated [-Wdeprecated-declarations]
        std::random_shuffle(arr.begin(), arr.end());// Shuffle the array
             ^
/Users/runner/work/C-Plus-Plus/C-Plus-Plus/sorting/bogo_sort.cpp:86:21: note: in instantiation of function template specialization 'sorting::randomized_bogosort<int, 5UL>' requested here
    arr1 = sorting::randomized_bogosort(arr1);
                    ^
/Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__algorithm/shuffle.h:96:23: note: 'random_shuffle<int *>' has been explicitly marked deprecated here
_LIBCPP_HIDE_FROM_ABI _LIBCPP_DEPRECATED_IN_CXX14 void
                      ^
/Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__config:1031:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX14'
#    define _LIBCPP_DEPRECATED_IN_CXX14 _LIBCPP_DEPRECATED
                                        ^
/Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__config:1010:49: note: expanded from macro '_LIBCPP_DEPRECATED'
#      define _LIBCPP_DEPRECATED __attribute__((__deprecated__))
                                                ^
1 warning generated.

Checklist

  • Added description of change
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes:

@MaximSmolskiy
Copy link
Member Author

@Panquesito7 @realstealthninja please review

Copy link
Collaborator

@realstealthninja realstealthninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done 👍🏽

@realstealthninja realstealthninja merged commit 1f5828e into TheAlgorithms:master Aug 31, 2024
7 checks passed
@MaximSmolskiy MaximSmolskiy deleted the fix-deprecation-warning-for-macOS branch August 31, 2024 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants